import request from './request'
<<<<<<< HEAD

<<<<<<< HEAD
<<<<<<< HEAD
// 列表type数据的请求
export function getlisttype () {
  return request({
    url: '/list',
=======
/**
 * 获取首页的列表数据
 * 使用 import { getProlist } from '@/api'
 * 数据接口参考：
 * http://localhost:3030/apidoc/#api-pro-GetApiPro
=======
/**
 * 获取首页的列表数据
 * import { getProlist } from '@/api'
 * 数据接口参考： http://localhost:3000/apidoc/#api-pro-GetApiPro
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
 * @param {Object} params 由limit和count组成的对象
 */
export function getProlist (params) {
  // limit和count的默认值 -- 依据接口文档设置
=======
// 请求列表的数据
export function getProlist (params) {
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
  const data = params || { limit: 10, count: 0 }
  return request({
    url: '/pro',
    method: 'get',
    params: data
  })
}

<<<<<<< HEAD
/**
 * 请求首页轮播图数据
 */
export function getBannerlist () {
  return request({
    url: '/banner',
<<<<<<< HEAD
>>>>>>> 61d95511f5bb548966870409910cdf315f439697
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
// 请求轮播图的数据
export function getBannerlist () {
  return request({
    url: '/banner',
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
    method: 'get'
  })
}

<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
// 列表商品数据的请求
export function getshowlist (params) {
  return request({
    url: '/show/pro',
=======
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
/**
 * 根据产品的id获取数据
 * @param {Object} params  { proid: '' }
 */
export function getDetailData (params) {
  return request({
    url: '/pro/detail',
<<<<<<< HEAD
>>>>>>> 61d95511f5bb548966870409910cdf315f439697
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
    method: 'get',
    params
  })
}

<<<<<<< HEAD
<<<<<<< HEAD
// 列表所有商品数据的请求
export function getprolist (params) {
  return request({
    url: '/list/pro',
=======
/**
 * 注册
 * @param {Object} params { tel: '', password: '' }
=======
/**
 * 注册
 * @param {Object} params { tel: '', password: ''}
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
/**
 * 注册
 * @param {Object} params { tel: '', password: ''}
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 */
export function register (params) {
  return request({
    url: '/users/register',
    method: 'post',
    data: params
  })
}
<<<<<<< HEAD
<<<<<<< HEAD
/**
 * 登录
 * @param {Object} params { tel: '', password: '' }
=======
=======
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5

/**
 * 登录
 * @param {Object} params { tel: '', password: ''}
<<<<<<< HEAD
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 */
export function login (params) {
  return request({
    url: '/users/login',
    method: 'post',
    data: params
  })
}
<<<<<<< HEAD
<<<<<<< HEAD
/**
 * 加入购物车
 * @param {Object} params { userid: '', proid: '',num: 1 }
=======

/**
 * 加入购物车
 * @param {Object} params { userid: '', proid: '', num: 1}
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======

/**
 * 获取产品详细数据 get 下面 params
 * @param {Object} params { proid: ''}
 */
export function getDetailData (params) {
  return request({
    url: '/pro/detail',
    method: 'get',
    params
  })
}

/**
 * 加入购物车 POS 下面 params
 * @param {Object} params { proid: '' ,userid: '', num: 1}
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 */
export function addCart (params) {
  return request({
    url: '/cart/add',
    method: 'post',
    data: params
  })
}

/**
<<<<<<< HEAD
 * 查看购物车
<<<<<<< HEAD
 * @param {Object} params { userid: '' }
=======
 * @param {Object} params { userid: ''}
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
 */
export function getCartData (params) {
  return request({
    url: '/cart',
<<<<<<< HEAD
>>>>>>> 61d95511f5bb548966870409910cdf315f439697
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
 * 获取购物车的数据 get
 * @param {Object} params {userid: ''}
 */
export function getaddCartData (params) {
  return request({
    url: '/cart',
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
    method: 'get',
    params
  })
}
<<<<<<< HEAD

<<<<<<< HEAD
<<<<<<< HEAD
// 详情数据的请求
export function getdetaillist (params) {
  return request({
    url: '/list/detail',
=======
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
/**
 * 更新购物车
 * @param {Object} params { cartid: '', num: 0 }
=======
/**
 * 更新购物车 get
 * @param {Object} params { cartid: '',num: 0}
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 */
export function updateCartData (params) {
  return request({
    url: '/cart/update',
<<<<<<< HEAD
<<<<<<< HEAD
>>>>>>> 61d95511f5bb548966870409910cdf315f439697
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
    method: 'get',
    params
  })
}

<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
// 加入购物车数据的请求
export function cartAdd (params) {
  return request({
    url: '/cart/add',
=======
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
/**
 * 删除购物车
 * @param {Object} params { cartid: '' }
 */
export function deleteCartData (params) {
=======
/**
 * 删除商品接口 get
 * @param {Object} params { cartid: '' }
 */
export function delCartData (params) {
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
  return request({
    url: '/cart/delete',
    method: 'get',
    params
  })
}

/**
<<<<<<< HEAD
<<<<<<< HEAD
 * 添加订单 --- 确认订单
 * @param {Object} params { userid: '', orderlist: '[{}, {}]' }
=======
 * 添加订单  ---  确认订单
 * @param {Object} params { userid: ''， orderlist: '[{},{}]' }
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
 * 添加订单 --- 确认订单
 * @param {Object} params { userid: '', orderlist: '[{}, {}]'}
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 */
export function addOrder (params) {
  return request({
    url: '/order/add',
    method: 'post',
    data: params
  })
}

/**
<<<<<<< HEAD
<<<<<<< HEAD
 * 查询订单 --- 确认订单
 * @param {Object} params { orderid: '' }
=======
 * 查询  ---  确认订单
 * @param {Object} params { orderid: ''}
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
 * 查询订单 --- 确认订单
 * @param {Object} params { orderid: ''}
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 */
export function getOrderData (params) {
  return request({
    url: '/order',
    method: 'get',
    params
  })
}

/**
<<<<<<< HEAD
 * 添加地址
=======
 * 插入地址
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 * @param {Object} params { userid, isDefault, name, tel, province, city, county, addressDetail }
 */
export function addAddress (params) {
  return request({
    url: '/address/add',
    method: 'post',
    data: params
  })
}

/**
<<<<<<< HEAD
 * 获取地址列表
=======
 * 获取用户地址列表
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 * @param {Object} params { userid }
 */
export function getAddressData (params) {
  return request({
    url: '/address',
    method: 'get',
    params
  })
}

/**
 * 修改订单的收货人信息
<<<<<<< HEAD
 * @param {Object} params { orderid, addressid }
=======
 * @param {Object} params { order, addressid }
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 */
export function updateOrderAddress (params) {
  return request({
    url: '/order/updateAddress',
    method: 'get',
    params
  })
}

/**
<<<<<<< HEAD
<<<<<<< HEAD
 * 获取分类的接口
=======
 * 支付
 * @param {Object} params { body: '', out_trade_no: '', total_fee: '' }
 */
export function pay (params) {
  return request({
    url: '/pay/payment',
    method: 'post',
    data: params
  })
}

/**
 * 获取分类接口
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
 */
export function getCategory () {
=======
 * 获取分类的接口
 */
export function getCartgory () {
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
  return request({
    url: '/category/getCategory',
    method: 'get'
  })
}
<<<<<<< HEAD
<<<<<<< HEAD

=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
/**
 * 获取分类下品牌接口
 * @param {Object} params { type }
 */
<<<<<<< HEAD
export function getCategoryBrand (params) {
  return request({
    url: '/category/getCategoryBrand',
<<<<<<< HEAD
>>>>>>> 61d95511f5bb548966870409910cdf315f439697
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
export function getCartgoryBrand (params) {
  return request({
    url: '/category/getCategoryBrand',
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
    method: 'get',
    params
  })
}
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8

/**
 * 获取当前分类下当前品牌的产品数据
 * @param {Object} params { type, brand }
 */
export function getCategoryBrandList (params) {
  return request({
    url: '/category/getCategoryBrandList',
=======
/**
 * 获取分类下品牌的产品数据接口
 * @param {Object} params { type, brand }
 */
export function getCategoryBrandlist (params) {
  return request({
    url: '/category/getCategoryBrandlist',
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
    method: 'get',
    params
  })
}

/**
<<<<<<< HEAD
<<<<<<< HEAD
 * 获取当前用户信息
=======
 * 获取当前用户的信息
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
 * 获取当前用户信息
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 * @param {Object} params { userid, token }
 */
export function getuserinfo (params) {
  return request({
    url: '/users/getuserinfo',
    method: 'get',
    params
  })
}

/**
 * 修改用户信息
 * @param {Object} params { userid, token, nickname, email, sex }
 */
export function updateinfo (params) {
  return request({
    url: '/users/updateinfo',
    method: 'post',
    data: params
  })
}

/**
<<<<<<< HEAD
<<<<<<< HEAD
 * 更新头像信息
=======
 * 更新头像
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
 * 更新头像
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 * @param {Object} params { userid, token, avatar }
 */
export function updateAvatar (params) {
  return request({
    url: '/users/updateAvatar',
    method: 'post',
    data: params
  })
}

/**
<<<<<<< HEAD
 * 收藏的产品
=======
 * 获取收藏的产品数据
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
 * @param {Object} params { collectionData, token }
 */
export function getCollection (params) {
  return request({
    url: '/users/getCollection',
    method: 'get',
    params
  })
}
<<<<<<< HEAD
<<<<<<< HEAD

/**
 * 修改地址
 * @param {Object} params { addressid }
 */
export function modifyAddress (params) {
  return request({
    url: '/address/modify',
    method: 'get',
    params
  })
}

/**
 * 更新地址
 * @param {Object} params { addressid, userid, token, isDefault, name, tel, province, city, county, addressDetail }
 */
export function updateAddress (params) {
  return request({
    url: '/address/update',
    method: 'post',
    data: params
  })
}
>>>>>>> 61d95511f5bb548966870409910cdf315f439697
=======
>>>>>>> 68b657acc83398406018ec9d69a526c64a82d2c8
=======
>>>>>>> 466a1d600ce65f8e3bdcad18a08a41e8b81613e5
